package com.wolfman.uploadfile.service.impl;

import com.wolfman.uploadfile.mapper.FileDownloadMapper;
import com.wolfman.uploadfile.po.FileDownload;
import com.wolfman.uploadfile.service.FileDownloadService;
import com.wolfman.uploadfile.service.FileDownloadService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Title
 * @Description
 * @Author WolfMan
 * @Date 2021/8/23 13:54
 * @Email 2370032534@qq.com
 */
@Service
@Transactional(rollbackFor = {Exception.class})
public class FileDownloadServiceImpl implements FileDownloadService {
    @Resource
    FileDownloadMapper fileDownloadMapper;


    @Override
    public void insertOne(FileDownload fileDownload) {
        fileDownloadMapper.insertOne(fileDownload);
    }

    @Override
    public void updateProcess(FileDownload fileDownload) {
        fileDownloadMapper.updateProcess(fileDownload);
    }

    @Override
    public FileDownload selectById(FileDownload fileDownload) {
        return fileDownloadMapper.selectById(fileDownload);
    }

    @Override
    public Double selectProcessById(FileDownload fileDownload) {
        return fileDownloadMapper.selectProcessById(fileDownload);
    }

    @Override
    public List<FileDownload> selectAllUnfinished() {
        return fileDownloadMapper.selectAllUnfinished();
    }

    @Override
    public void deleteById(FileDownload f) {
        fileDownloadMapper.deleteById(f);
    }

    @Override
    public void updateInfo(FileDownload fileDownload) {
        fileDownloadMapper.updateInfo(fileDownload);
    }
}
